from fpdf import FPDF
import cv2
gw = 2
gh = 7
import numpy as np
tco =0
def one(l):
    global tco
    tco += 1
    hh = []
    co = 0
    for i in range(gh):
        ii = np.hstack((l[co:co+gw]))
        hh.append(ii)
        co += gw
    to = np.vstack(hh)    
    cv2.imwrite(str(tco)+'.jpg',to)

cam = cv2.VideoCapture('ss.mp4')
fps = cam.get(cv2.CAP_PROP_FPS)
print(fps)

ll = []
for i in range(1*14):
    b = cv2.imread('img/'+str(i)+'.jpg')
    ll.append(b)
    if len(ll)==gw*gh:
        one(ll)
        ll = []
exit()        
for i in range(5000000):
    print(i)
    a,b = cam.read()
    if not a:
        break
    if i%300==0:        
        ll.append(b)
        if len(ll)==gw*gh:
            one(ll)
            ll = []
